<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
  <meta http-equiv="Content-Type" content=
  "text/html; charset=UTF-8">

  <title>DURABILITY</title>
  <link rel="stylesheet" type="text/css" href="QoS.css">
  <link rel="stylesheet" type="text/css" href="../../styles.css">
</head>

<body>

<H4 CLASS="Head3">
<A NAME="pgfId-163688"></A>DURABILITY</H4>
<UL>
<LI CLASS="BodyNoLead">
<A NAME="pgfId-182692"></A>The <A NAME="marker-249632"></A>DURABILITY policy controls whether <A NAME="marker-182690"></A>data writers should maintain <A NAME="marker-182691"></A>samples after they have been sent to known <A NAME="marker-182693"></A>subscribers. This policy applies to the <A NAME="marker-186985"></A>topic, <A NAME="marker-267616"></A>data reader, and <A NAME="marker-267641"></A>data writer entities via the <EM CLASS="Code">
durability</EM>
 member of their respective QoS structures. Below is the IDL related to the durability QoS policy:</LI>
<LI CLASS="Body">
<A NAME="pgfId-181369"></A><EM CLASS="Code">
</EM>
&nbsp;</LI>
<LI CLASS="Body">
<A NAME="pgfId-181380"></A><EM CLASS="Code">
enum DurabilityQosPolicyKind {</EM>
</LI>
<LI CLASS="Body">
<A NAME="pgfId-181381"></A><EM CLASS="Code">
  VOLATILE_DURABILITY_QOS,         // Least Durability</EM>
</LI>
<LI CLASS="Body">
<A NAME="pgfId-181382"></A><EM CLASS="Code">
  TRANSIENT_LOCAL_DURABILITY_QOS,</EM>
</LI>
<LI CLASS="Body">
<A NAME="pgfId-201421"></A><EM CLASS="Code">
  TRANSIENT_DURABILITY_QOS,</EM>
</LI>
<LI CLASS="Body">
<A NAME="pgfId-181384"></A><EM CLASS="Code">
  PERSISTENT_DURABILITY_QOS        // Greatest Durability</EM>
</LI>
<LI CLASS="Body">
<A NAME="pgfId-181385"></A><EM CLASS="Code">
};</EM>
</LI>
<LI CLASS="Body">
<A NAME="pgfId-181386"></A><EM CLASS="Code">
</EM>
&nbsp;</LI>
<LI CLASS="Body">
<A NAME="pgfId-181387"></A><EM CLASS="Code">
struct DurabilityQosPolicy {</EM>
</LI>
<LI CLASS="Body">
<A NAME="pgfId-181388"></A><EM CLASS="Code">
  DurabilityQosPolicyKind kind;</EM>
</LI>
<LI CLASS="Body">
<A NAME="pgfId-181389"></A><EM CLASS="Code">
  Duration_t service_cleanup_delay;</EM>
</LI>
<LI CLASS="Body">
<A NAME="pgfId-192355"></A><EM CLASS="Code">
};</EM>
</LI>
<LI CLASS="Body">
<A NAME="pgfId-199320"></A>&nbsp;</LI>
<LI CLASS="Body">
<A NAME="pgfId-192363"></A>By default the <EM CLASS="Code">
kind</EM>
 is <EM CLASS="Code">
VOLATILE_DURABILITY_QOS</EM>
 and <EM CLASS="Code">
service_cleanup_delay</EM>
 is zero which means infinite time delay.</LI>
<LI CLASS="Body">
<A NAME="pgfId-278049"></A>A durability kind of <EM CLASS="Code">
VOLATILE_DURABILITY_QOS</EM>
 means samples are discarded after being sent to all known subscribers. As a side effect, subscribers cannot recover samples sent before they connect.</LI>
<LI CLASS="Body">
<A NAME="pgfId-266897"></A>A durability kind of <EM CLASS="Code">
TRANSIENT_LOCAL_DURABILITY_QOS </EM>
means that data readers that are associated/connected with a data writer will be sent all of the samples in the data writer’s history.</LI>
<LI CLASS="Body">
<A NAME="pgfId-182282"></A>A durability kind of <EM CLASS="Code">
TRANSIENT_DURABILITY_QOS</EM>
 means that samples outlive a data writer and last as long as the process is alive. The samples are kept in memory, but are not persisted to permanent storage. A data reader subscribed to the same topic and partition within the same domain will be sent all of the cached samples that belong to the same topic/partition.</LI>
<LI CLASS="Body">
<A NAME="pgfId-189697"></A>A durability kind of <EM CLASS="Code">
PERSISTENT_DURABILITY_QOS</EM>
 provides basically the same functionality as transient durability except the cached samples are persisted and will survive process destruction.</LI>
<LI CLASS="Body">
<A NAME="pgfId-278060"></A>When transient or persistent durability is specified, the <EM CLASS="Code">
service_cleanup_delay </EM>
specifies how long to delay the instance cleanup after the instance is disposed and all data writers unregister the instance.<EM CLASS="Code">
</EM>
</LI>
<LI CLASS="Body">
<A NAME="pgfId-190761"></A>The durability policy is considered during the creation of associations between data writers and data readers. The value of both sides of the association must be compatible in order for an association to be created. The durability kind value of the data writer must be greater than or equal to the corresponding value of the data reader. The durability kind values are ordered as follows:</LI>
</UL>
<P CLASS="Code">
<A NAME="pgfId-267377"></A>&nbsp;</P>
<UL>
<LI CLASS="Body">
<A NAME="pgfId-267396"></A><EM CLASS="Code">
PERSISTENT_DURABILITY_QOS &gt;</EM>
</LI>
<LI CLASS="Body">
<A NAME="pgfId-267515"></A><EM CLASS="Code">
TRANSIENT_DURABILITY_QOS &gt;</EM>
</LI>
<LI CLASS="Body">
<A NAME="pgfId-267456"></A><EM CLASS="Code">
TRANSIENT_LOCAL_DURABILITY_QOS &gt;</EM>
</LI>
<LI CLASS="Body">
<A NAME="pgfId-267486"></A><EM CLASS="Code">
VOLATILE_DURABILITY_QOS</EM>
</LI>
<LI CLASS="Body">
<A NAME="pgfId-267544"></A>&nbsp;</LI>
</UL>

</body>
</html>
